package com.wh1200.mybatis.xmlless.starter

import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration


/**
 *
 * Created by 吴昊 on 2018/12/6.
 *
 * @author 吴昊
 * @since 0.0.1
 */
@Configuration
@EnableConfigurationProperties(MyBatisXmllessConfig::class)
@ConfigurationProperties(prefix = "mybatis.wh1200")
class MyBatisXmllessConfig {

  @Bean
  @ConditionalOnMissingBean
  fun paginationInterceptor(): PaginationInnerInterceptor {
    return PaginationInnerInterceptor()
  }

}
